import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;


public class OutputStreamDemo {
	public static void main(String[] args) throws IOException{
		//byte[] b= new byte[]{97,119,100,123,122,97,98};
		FileInputStream in= new FileInputStream("D:\\workspace\\JavaProExample10\\src\\1.txt");
		//byte[] b=new byte[1024];
		//in.read(b);
		OutputStream out =new FileOutputStream("D:\\workspace\\JavaProExample10\\src\\2.txt");
		byte[] b=new byte[4];
		int len=0;
		while(len !=-1){
			len =in.read(b);
			out.write(b,0,len);
		}
		//out.write(b[0]);
		//out.write(b);
		out.close();
		out.close();
	}

}
